package com.keyancompany.zhongbaopingtai.weight;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.keyancompany.zhongbaopingtai.R;
import com.keyancompany.zhongbaopingtai.api.CircleAPI;
import com.keyancompany.zhongbaopingtai.api.TeamAPI;
import com.keyancompany.zhongbaopingtai.listener.IAsyncHttpResponseHandler;
import com.keyancompany.zhongbaopingtai.utils.KeyBoardUtils;
import com.keyancompany.zhongbaopingtai.utils.ScreenUtils;

/**
 * Created by firefox on 2016/7/2.
 */
public class AnswerPopup extends MenuPopuWindow {

    private ImageView sure;
    private CustomEditText content;

    public AnswerPopup(Context context) {
        super(context);
    }


    @Override
    public void setUpViews() {
        sure = (ImageView) findViewById(R.id.send);
        content = (CustomEditText) findViewById(R.id.content);
    }

    @Override
    public void setUpListener() {

        sure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                clickEvent();

            }
        });
    }

    void clickEvent() {
        if (TextUtils.isEmpty(content.getText().toString())) {
            return;
        }
        if (cliclSureListener != null) {
            cliclSureListener.clickSureLinstener(content.getText().toString());
        }
    }

    @Override
    public int getAnimationStyle() {
        return 0;
    }

    @Override
    public int getResView() {
        return R.layout.poup_answer_view;
    }

    @Override
    public void updateView(View contentView) {
    }

    public void clearContent() {
        if (content != null) {
            content.setText("");
            KeyBoardUtils.closeKeybord(content, context);
        }
    }
}
